
<%@include file="header.jsp"%>
<%@page import="br.unirio.ticketnator.model.Usuario"%>
<%@page import="br.unirio.ticketnator.dao.UsuarioDAO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="br.unirio.ticketnator.dao.DAOFactory"%>

<div class="container">

    <h2 class="form-signin-heading">Usuarios</h2>
    <table class="table table-bordered">
        <tr>
                <td>nome</td>
                <td>sobrenome</td>
                <td>email</td>
                <td>codigo permissao</td>
            </tr>
            <% List<Usuario> lista = DAOFactory.getUsuarioDAO().lista(0, 25);
             for (int i =0; i < lista.size(); i++){%>
            <tr>
                <td><%out.print(lista.get(i).getNome());%></td>
              
                <td><%out.print(lista.get(i).getSobrenome());%></td>
                <td><%out.print(lista.get(i).getEmail());%></td>
                <td><%out.print(lista.get(i).getCodPermissao());%></td>
                <td><a href="edit_usuario.jsp?id=<%out.print(lista.get(i).getIdUsuario());%>" class="navbar-link">Editar</a></td>
            </tr>
        <%} %>
        </table>
        <s:url id="nextURL" action="list"><s:param name="page"><s:property value="nextPage"/></s:param></s:url>
        <s:url id="prevURL" action="list"><s:param name="page"><s:property value="previousPage"/></s:param></s:url>
        
</div> <!-- /container -->


<%@include file="footer.jsp"%>